package com.sxy.web;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author 宋鑫宇
 * @version 1.0
 * 使用urlPattern：一个Servlet可以配置多个访问路径
 * 匹配规则：
 *      精确匹配：
 *      目录匹配：
 *      扩展名匹配：
 */
//@WebServlet(urlPatterns = {"/demo3","/demo4"})  //匹配多个名
//    @WebServlet("/user/demo3") // 精确匹配，优先访问精确匹配
//    @WebServlet("/user/*") //目录匹配
//    @WebServlet("*.do") //扩展名匹配：不能以/开头，不然会报错
//    @WebServlet("/") //@WebServlet("/*") //任意匹配，/*的优先级会高于/
public class ServletDemo03 extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        super.doPost(req, resp);
    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        super.doGet(req, resp);
    }
}
